package cz.cvut.fit.web.nakupniSeznam.ws.conv;

import java.net.URI;
import java.util.ArrayList;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import cz.cvut.fit.web.nakupniSeznam.data.Item;

@XmlRootElement(name = "items")
@XmlType(propOrder = { "item" })
public class ItemsConverter {

	public ItemsConverter() {

	}

	public ItemsConverter(java.util.List<Item> items, URI uri) {
		super();
		item = new ArrayList<ItemConverter>();
		
		for (Item i : items) {
			this.item.add(new ItemConverter(i));
		}
		
		/*String s = uri.getPath().replaceFirst("/user/.*", "/list/");
		for (List l : lists) {
			URI listUri = URI.create(s + l.getId()+ "/detail");
            URI resolvedUri = uri.resolve(listUri); 
			this.list.add(new ListConverter(l, resolvedUri));
		}*/
	}

	private java.util.List<ItemConverter> item;

	@XmlElement
	public java.util.List<ItemConverter> getItem() { 
		return item;
	}

	public void setItem(java.util.List<ItemConverter> item) {
		this.item = item;
	}
	
	

}
